<template>
  <div class="box">
    <div class="title" v-if="title">
      <span>{{ title }}</span>
      <div>
        <slot name="action" />
      </div>
    </div>
    <div class="content">
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  name: "my-card",
  props: {
    title: {
      type: String,
      default: ""
    }
  }
};
</script>
<style lang="scss" scoped>
.box {
  border: 1px solid #ccc;
  .title {
    border-bottom: 1px solid #ccc;
    padding: 15px 20px;
    @include flex(space-between, center);
  }
  .content {
    padding: 15px 20px;
  }
}
</style>
